<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
	</head>
	<body>
		<?php

		echo '<table align="centrer" border="1" cellspacing="2" cellpadding="2">
		<tr>
		<td align="left"><b>role_id</b></td>
		<td align="left"><b>name</b></td>
		<td align="left"><b>description</b></td>
		<td align="left"><b>locked</b></td>
		<td align="left"><b>number_of_users</b></td>
		</tr>';

		while ($row=$this->result->fetch())
		{
			$id =$row['role_id'];
			echo '<tr><td align=\"left\">';
			echo $row['role_id'];
			echo '</td><td align=\"left\">';
			echo $row['name'];
			
			if($row['locked']==0)
			{
				echo "<br/><a href='/Apprentice_CMS/public/admin/role/lock/id/".$row['role_id']."'>Lock</a>&nbsp<a href='/Apprentice_CMS/public/admin/role/remove/id/".$row['role_id']."'>Remove</a>&nbsp<a href='/Apprentice_CMS/public/admin/role/permission/id/$id'>Permission</a>";
			}
			else if ($row['locked']==1)
			{
				echo "<br/><a href='/Apprentice_CMS/public/admin/role/unlock/id/".$row['role_id']."'>UnLock</a>&nbsp<a href='/Apprentice_CMS/public/admin/role/permission/id/$id'>Permission</a>";
			}
			else
			{	
				echo "<br/><a href='/Apprentice_CMS/public/admin/role/permission/id/$id'>Permission</a>";
			}

			echo '</td><td align=\"left\">';
			echo $row['description'];
			echo '</td><td align=\"left\">';
			echo $row['locked'];
			
			//number of Users
			echo '</td><td align=\"left\">';
			echo $row['number_of_users'];
			//
			echo '</td></tr>';
		}
		echo "<br/><a href='/Apprentice_CMS/public/admin/role/submit'>Add new role</a>";
		echo '</table>';?>
	</body>
</html>

